package com.project.mapper;

import com.project.bean.LinkBean;
import com.project.provider.LinkProvider;
import org.apache.ibatis.annotations.*;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

public interface ILinkMapper {
    @Insert("insert into t_link(l_name,l_tel,l_birthday) values" +
            "(#{name},#{tel},#{birthday})")
    public void add(LinkBean link);
    @Delete("delete from t_link where pk_linkId=#{id};")
    public void del(int id);
    @Update("update t_link set l_tel=#{tel} where pk_linkId=#{id}")
    public void update(@Param("id") int id,@Param("tel") String tel);

    //type = LinkProvider.class拼接动态SQL的类名
    //method = "findByItemSql" 拼接动态SQL的方法名
    @SelectProvider(type = LinkProvider.class,method = "findByItemSql")
    @ResultMap("linkMap")
    public List<LinkBean> findByItem(Map map);

    public LinkBean findById(int id);
}
